package com.czxy.dem01;

import java.util.ArrayList;
import java.util.List;

public class Test13 {

    public static void main(String[] args) {

        Employee emp01 = new Employee("小明",1800);
        Employee emp02 = new Employee("小新",2600);

        List<Employee> list = new ArrayList<>();
        list.add(emp01);
        list.add(emp02);
        for (Employee employee : list) {
            if (employee.getName().equals("小明")) {
                employee.setSalary(employee.getSalary()+300);
            }
        }
        for (Employee employee : list) {
            System.out.println(employee);
        }
    }
}
